import unittest
from BeautifulReport import BeautifulReport
import yagmail

def send_baogao():
    report=unittest.defaultTestLoader.discover(start_dir='./', pattern='Case.py')
    port=BeautifulReport(report)
    port.report(filename='web.html',description='测试报告',report_dir='./')

def send_email():
    email=yagmail.SMTP(user='2250722618@qq.com', password='xrpnysvdhufidieg',host='smtp.qq.com')
    email.send(to='2250722618@qq.com',subject='QQ邮件')

if __name__ == '__main__':
    send_email()
    send_baogao()

